package xyz.eden.boot.push.application.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import xyz.eden.boot.push.application.bo.ReachInfoBO;
import xyz.eden.boot.push.application.service.ReachService;
import xyz.eden.boot.push.infrastructure.proxy.UserServiceProxy;
import xyz.eden.boot.push.infrastructure.proxy.dto.UserBaseInfoDTO;

import javax.annotation.Resource;

/**
 * ReachServiceImpl
 *
 * @author gavin
 * @version 1.0
 * @descriptor
 * @date 2023/7/30 17:48
 */
@Slf4j
@Service
public class ReachServiceImpl implements ReachService {

    @Resource
    private UserServiceProxy userServiceProxy;

    @Override
    public ReachInfoBO getUserReachInfo(Long userId) {
        UserBaseInfoDTO dto = userServiceProxy.getUserBaseInfo(userId);
        return ReachInfoBO.builder()
                .userId(dto.getId()).username(dto.getUsername())
                .build();
    }
}
